import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from '@tli/ui/components/table'

export type DataApi = {
  id: string
  name: string
  path: string
  group?: string
}

export function ApiTable({ apis }: { apis: DataApi[] }) {
  return (
    <Table>
      <TableHeader>
        <TableRow>
          <TableHead className="w-[100px]">Id</TableHead>
          <TableHead>Name</TableHead>
          <TableHead>Path</TableHead>
          <TableHead>Group</TableHead>
          <TableHead className="text-right">Actions</TableHead>
        </TableRow>
      </TableHeader>
      <TableBody>
        {apis.map(({ id, name, path, group }) => (
          <TableRow key={id}>
            <TableCell className="font-medium">{id}</TableCell>
            <TableCell>{name}</TableCell>
            <TableCell>{path}</TableCell>
            <TableCell>{group}</TableCell>
            <TableCell className="text-right">...</TableCell>
          </TableRow>
        ))}
      </TableBody>
    </Table>
  )
}
